----------------------------
DEPOSIT DATE:	
-----------------------------
ARTICLE:	“How Do Electoral Outcomes Affect Campaign Contributions? The Role of Personal Loyalty and Investment Motives”
AUTHORS:	Miguel R. Rueda, and Nelson A. Ruiz
------------------------------------------------------------------------------------------
Replication files and code to reproduce the tables and figures in the paper and the online appendix. Report any error or bug to:miguel.rueda@emory.edu

All data analyses in this article were performed using Stata/SE 17.0 for Windows (64-bit 86-64).


------------------------------------------------------------------------------------------
FILE LIST:

***********************************
* Datasets and codebooks         *
* (contained in the "Data" folder)*
***********************************

(1) cand_level_persist_rep.dta

Contains mayoral candidate-level data (2011 candidates).

(2) council_cand_level_persist_rep.dta

Contains council candidate-level data (2011 candidates).

(3) donor_level_persist_rep.dta

Contains donor-level data (2011 election donors).	

(4) muni_charac_rep.dta

Contains municipality characteristics.

(5) Codebooks

A codebook for each database is included in the "Codebooks" folder within the "Data" folder. 

(1) codebook_cand_level_persist_rep.docx: codebook for cand_level_persist_rep.dta
(2) codebook_council_cand_level_persist_rep.docx: codebook for council_cand_level_persist_rep.dta
(3) codebook_donor_level_persist_rep.docx: codebook for donor_level_persist_rep.dta
(4) codebook_muni_charac_rep.docx: codebook for muni_charac_rep.dta


***********************************
* Do files                        *
* (contained in the "Do files" folder)*
***********************************


(1) Table1.do: replicates Table 1
(2) Table2.do: replicates Table 2
(3) Table3.do: replicates Table 3
(4) Table4.do: replicates Table 4
(5) TableA1.do: replicates Table A1
(6) TableA2.do: replicates Table A2
(7) TableA3.do: replicates Table A3
(8) TableA4.do: replicates Table A4
(9) TableA5.do: replicates Table A5
(10) TableB1.do: replicates Table B1
(11) TableC1.do: replicates Table C1
(12) TableC2.do: replicates Table C2
(13) TableF1.do: replicates Table F1
(14) TableF2.do: replicates Table F2
(15) TableF3.do: replicates Table F3
(16) TableF4.do: replicates Table F4
(17) TableF5.do: replicates Table F5
(18) TableG1.do: replicates Table G1
(19) TableG2.do: replicates Table G2
(20) TableG3.do: replicates Table G3
(21) TableG4.do: replicates Table G4
(22) TableG5.do: replicates Table G5
(23) TableG6.do: replicates Table G6
(24) TableG7.do: replicates Table G7
(25) TableG8.do: replicates Table G8
(26) TableG9.do: replicates Table G9
(27) TableG10.do: replicates Table G10
(28) TableH1.do: replicates Table H1
(29) TableH2.do: replicates Table H2
(30) TableH3.do: replicates Table H3

(31) Fig1_D2_D4_D6.do: replicates Figures 1, D2, D4, and D6
(32) FigH1_H2.do: replicates Figures H1 and H2
(33) FigD1_D3_D5_E1-3.do: replicates Figures D1, D3, D5, E1, E2, and E3
(34) FigH4_H5.do: replicates Figures H4 and H5
(35) FigC1-H3.do: replicates Figures C1 and H3


***********************************
* Log files                        *
* *				   *
***********************************

(1) replication_all.smcl
(2) replication_all.txt 


***********************************
* Replication                     *
* 				  *
***********************************

To replicate all tables and figures in the paper and the supplementary materials do the following:


1. Select the Table or Figure you wish to replicate, change the location paths for the datasets used as inputs as well as that of folders where the tables and figures will be saved.
2. Run the file.
3. Add the following to the start of the latex file used to display the tables generated by the code: 
	
	\usepackage{array}
	\newcolumntype{H}{>{\setbox0=\hbox\bgroup}c<{\egroup}@{}} 

Doing this will prevent empty columns from displaying. 


Notes:
- You might need to install the following packages: rdrobust, rddensity, lpdensity, sensemakr, texdoc. The results reported in the paper are consistent with those in the logs which use the end of 2020 versions of those commands.
- Figures 1, D2, D4, and D6 will not be saved by the do file but just displayed on the screen. The information for Table B1 will be displayed on the screen but not saved in tex format.
- For all RD estimates we report in the tables the `conventional' estimate and the `Robust' p-values and confidence intervals as explained in the paper.


